import { FMVCS } from "../../fgui/fmvc/FMVCS";
import TipsCtrl from "./TipsCtrl";

export default class TipsView extends FMVCS.FView {
    clickHandlers(){
        return [
            // [this._views[`btnStart`], this.onBtnStart, this],
        ];
    }

    onOpenCallBack(){
        let text = TipsCtrl.data.vo.text;
        this.showFloatText(text);
    }

    showFloatText(text: string = ``){
        let lbl = this._views[`lblText`].asLabel;
        lbl.text = text;
        let eff = this.getTransition(`tipsFloat`);
        eff.stop();
        eff.play(this.onTipsComplete.bind(this));
    }

    onTipsComplete(){
        this.onClose();
        TipsCtrl.data.vo.callBack && TipsCtrl.data.vo.callBack();
    }
}